package io.zsy.consumer;

import io.zsy.channel.DefaultSink;
import org.springframework.cloud.stream.annotation.EnableBinding;
import org.springframework.cloud.stream.annotation.StreamListener;
import org.springframework.stereotype.Component;

/**
 * 约定大于配置测试
 *
 * @author: zhangshuaiyin
 * @date: 2021/12/22 21:55
 */
@Component
@EnableBinding(DefaultSink.class)
public class DefaultConsumer {

    /**
     * 接收消息
     *
     * @param message message
     */
    @StreamListener(DefaultSink.INPUT)
    public void receive(String message) {
        System.out.println("从MQ中消费到消息：" + message);
    }
}
